<?php
	include("../includes/connect_db.php");

	$table = (isset($_POST["table"])) ? $_POST["table"] : "" ;
	$field = (isset($_POST["field"])) ? $_POST["field"] : "" ;
	$vals = (isset($_POST["vals"])) ? $_POST["vals"] : "" ;

	$data = array();
	$data["errorMessage"] = "";

	$sql = "DELETE FROM ".$table;

	if (count($vals>0)) {
		$i = 1;
		$sql .= " WHERE ".$field." IN (";
		foreach ($vals as $value) {
			if ($i > 1) {
				$sql .= ", ";
			}
			$sql .= $value;
			$i++;
		}
		$sql .= ")";
	}

	$query = mysql_query($sql);
	if ($query) {
		$data["errorMessage"] = "";
	}
?>